package com.dp.mallchat.common.chat.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @Author: dupeng
 * @CreateTime: 2024-07-29  14:51
 * @Description: 消息标记实体
 */
@Getter
@AllArgsConstructor
public enum MessageMarkActTypeEnum {

    ACT(1, "确认标记"),
    NO_ACT(2, "取消标记"),
    ;

    private Integer type;

    private String desc;

    private static Map<Integer, MessageMarkActTypeEnum> cache;

    static {
        cache = Arrays.stream(MessageMarkActTypeEnum.values()).collect(Collectors.toMap(MessageMarkActTypeEnum::getType, Function.identity()));
    }

    public static MessageMarkActTypeEnum of(Integer type) {
        return cache.get(type);
    }

}
